package com.banggood.upms.bean.vo;

import com.banggood.upms.bean.vo.validation.AddGroup;
import com.banggood.upms.bean.vo.validation.UpdateGroup;
import com.banggood.upms.common.constant.StatusEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;

/**
 * @author XuChuangFeng
 */
@Data
public class UserVo implements Serializable {

    @NotNull(message = "{validation.NotNull.id}", groups = {UpdateGroup.class})
    @Null(message = "{validation.Null.id}", groups = {AddGroup.class})
    private String userId;

    @NotNull(message = "{validation.UserVo.accountName.NotNull}", groups = {AddGroup.class})
    private String accountName;

    @NotNull(message = "{validation.UserVo.realName.NotNull}", groups = {AddGroup.class})
    private String realName;

    private String email;

    private String phone;

    @NotNull(message = "{validation.UserVo.password.NotNull}", groups = {AddGroup.class})
    private String password;

    private StatusEnum isActive;

    @NotNull(message = "{validation.UserVo.scope.NotNull}", groups = {AddGroup.class})
    private String scope;

    private String remark;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private String creationTime;
}